<template>
	<!-- :iconLeft="true" 显示左返回 || :isBack="true" @goBack="goBack" ：自定义返回； 不写默认返回上一层 -->
	<view>
		<view class="navBar ff-flex" :style="navStyle">
			<view class="content ff-text-center">
				<view class="iconLeft ff-align-items-one" v-if="iconLeft" @click="backClick">
					<image src="https://fire-system.oss-cn-beijing.aliyuncs.com/web/fire-technology/back.png" mode="">
					</image>
					<!-- <view><u-icon name="arrow-left" class="arrow-left" color="#ffffff" size="40"></u-icon></view> -->
					<!-- <view class="ff-font-15 ff-font-weight-500">返回</view> -->
				</view>
				{{ title }}
			</view>
		</view>
		<view :style="tabberStyle"></view>
	</view>
</template>

<script>
	export default {
		name: 'NavBack',
		props: ['title', 'iconLeft', 'isBack'],
		data() {
			return {};
		},
		computed: {
			navStyle() {
				return `height:${this.customBar}px;padding-top:${this.statusBar}px;`;
			},
			tabberStyle() {
				return `height:${this.customBar}px;`;
			}
		},
		methods: {
			// 点击返回按钮
			backClick() {
				if (this.isBack) {
					this.$emit('goBack');
					return;
				}
				this.$pageJump.navigateBack();
			}
		}
	};
</script>

<style lang="scss" scoped>
	.navBar {
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		z-index: 99999;
		background-color: #3178ff;
		color: #ffffff;

		.content {
			flex: 1;
			font-size: 32rpx;
			font-weight: 500;
			display: flex;
			align-items: center;
			justify-content: center;

			.iconLeft {
				position: absolute;
				left: 0;
				padding: 10rpx 25rpx;
				font-size: 30rpx;
				font-weight: 400;
				display: flex;
				align-items: center;
				justify-content: center;

				image {
					width: 35rpx;
					height: 35rpx;
				}

				/deep/.arrow-left {
					font-weight: 300 !important;
					margin-right: 6rpx;
				}
			}
		}
	}
</style>